package com.paul.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ConsumerConfig;
import com.alibaba.dubbo.config.RegistryConfig;

//@Configuration
public class DubboConfiguration {

	@Bean
    public ApplicationConfig applicationConfig() {
        ApplicationConfig applicationConfig = new ApplicationConfig();
        applicationConfig.setName("consumer-test");
        return applicationConfig;
    }

	 @Bean
	 public ConsumerConfig consumerConfig() {
	        ConsumerConfig consumerConfig = new ConsumerConfig();
	        consumerConfig.setTimeout(3000);
	        return consumerConfig;
	  }
	
    @Bean
    public RegistryConfig registryConfig() {
        RegistryConfig registryConfig = new RegistryConfig();
        registryConfig.setAddress("zookeeper://192.168.56.2:2181");
        //registryConfig.setClient("curator");
        registryConfig.setProtocol("zookeeper");
        return registryConfig;
    }
}
